<template>
  <div class="charts" ref="charts">
  </div>
</template>

<script>
// 这里可以导入其他文件（比如：组件，工具js，第三方插件js，json文件，图片文件等等）
import echarts from "echarts";
export default {
  // 定义属性
  data() {
    return {};
  },
  mounted() {
    this.getBarCharts();
  },
  methods: {
    getBarCharts() {
      let barCharts = echarts.init(this.$refs.charts);
      barCharts.setOption({
        xAxis: {
          show: false,
          type: "category",
        },
        yAxis: {
          show: false,
        },
        series: [
          {
            type: "bar",
            data: [10, 7, 33, 12, 48, 9, 29, 10, 44, 33, 22, 8],
            color: "cyan",
          },
        ],
        grid: {
          left: 0,
          top: 0,
          right: 0,
          bottom: 0,
        },
        tooltip: {
          show: true,
        },
      });
    },
  },
};
</script>


<style scoped>
.charts {
  width: 100%;
  height: 100%;
}
</style>
